<template>
    <div class='content'>

        <section>
            <div class="profile_page">
                    <head-top  :go-back='goBack'  :head-title="profiletitle"></head-top>
            </div>
            <!--<div class="my_backlog" >-->
              <van-list
                v-model="loading"
                :finished="finished"
                finished-text="没有更多了"
                @load="onLoad"
                :offset="offset"
              >
                <div v-for="item in remainData" :key="item.subid">
                  <div class="newsItem">
                    <div class="itemContent">
                      <div class="itemLists">
                        <div class="itemList">
                          <span class="itemName">姓名</span>
                          <span class="itemType">{{item.name}}</span>
                        </div>
                        <div class="itemList">
                          <span class="itemName">荣誉名称</span>
                          <span class="itemType">{{item.a428200}}</span>
                        </div>
                        <div class="itemList">
                          <span class="itemName">荣誉类型</span>
                          <span class="itemType">{{a428201}}</span>
                        </div>
                        <div class="itemList">
                          <span class="itemName">获取时间</span>
                          <span class="itemType">{{item.a428202}}</span>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </van-list>
        </section>
    </div>
</template>

<script>
    import headTop from '@/components/header/head';
    import {getHonorList} from '@/service/getData';
    import {getStore} from '@/assets/config/mUtils';
    import { Dialog,Toast } from 'vant';
    export default {
    	data(){
            return{
                profiletitle:'我的待办',
                goBack:true,
                CHECK_TIME: new Date().getTime().toString(),
                app_userId:'',
                remainData:[],
                loading: false,
                finished: false,
                pageIndex:0,
                offset: 0,
                type:'',
                a428201:''
            }
        },
        created(){
    	    this.app_userId = getStore('user_id');
    	    var state = this.$route.params.state;
    	    if(state == 'gj'){
    	      this.profiletitle = '查看国家荣誉';
    	      this.type = '3674000001';
    	      this.a428201 = '国家';
          }else if(state == 'jt'){
            this.profiletitle = '查看集团荣誉';
            this.type = '3674000002';
            this.a428201 = '集团';
          }else if(state == 'gs'){
            this.profiletitle = '查看公司荣誉';
            this.type = '3674000003';
            this.a428201 = '公司';
          }
        },
        mounted(){
//          Toast.loading({
//            duration: 0,   // 持续展示 toast
//            mask: true,
//            message: '正在加载...'
//          });
          /*var data ={};
          data.app_userId = this.app_userId;
          data.CHECK_TIME = this.CHECK_TIME;
          data.CHECK_SIGN = this.$md5(this.app_userId + this.CHECK_TIME +"3a28fba00c015e0df7f88556c91cb7fc");
          data.pageIndex = 0;
          data.pageSize = 1000;
          taskDatas(data).then(res=>{
            this.remainData = res.data.data;
            Toast.clear();
          })*/
//          this.onLoad();
        },
        components:{
            headTop,
        },
        methods:{
          onLoad(){
            var data ={};
            data.app_userId = this.app_userId;
            data.CHECK_TIME = this.CHECK_TIME;
            data.CHECK_SIGN = this.$md5(this.app_userId + this.CHECK_TIME +"3a28fba00c015e0df7f88556c91cb7fc");
            data.type = this.type;
            data.pageIndex = this.pageIndex;
            data.pageSize = 10;
            getHonorList(data).then(res=>{
//              console.log(res.data.data);
              // 加载状态结束
              this.loading = false;
              this.offset = 10 * this.pageIndex;
              if(res.data.data.length){
                this.remainData.push(...res.data.data);
              }else {
                this.finished = true;
              }
            });
            this.pageIndex+=1;
          },
        }
    }

</script>

<style lang="scss" scoped>
    @import '../../assets/style/mixin';
      @import '../../assets/style/public';
      .van-icon {
        font-family: "iconfont" !important;
        font-size: 16px;
        font-style: normal;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        }
    .van-icon-arrow{
        transform:rotate(-90deg);
        &:before{
                content: "\e634";
            }
    }
    .router-slid-enter-active, .router-slid-leave-active {
        transition: all .4s;
    }
    .router-slid-enter, .router-slid-leave-active {
        transform: translate3d(2rem, 0, 0);
        opacity: 0;
    }
      .newsItem{
        padding-top: 0.5rem;
        .itemDate{
          display: flex;
          justify-content: center;
          font-size:0.6rem;
          color: #cccccc;
          height: 1.6rem;
          line-height:1.6rem;
        }
        .itemContent{
          margin: 0 0.5rem;
          background-color: #fff;
          padding: 0 0.4rem;
          border-top-left-radius: 0.2rem;
          border-top-right-radius: 0.2rem;
          position: relative;
          z-index: 99;
          .itemConHead{
            display: flex;
            align-items: center;
            font-size: 0.6rem;
            color: #333333;
            line-height: 0.8rem;
            padding:0.6rem 0;
            border-bottom: 1px solid #eee;
          }
          .itemLists{
            padding: 0.08rem;
            .itemList{
              display: flex;
              padding: 0.32rem 0;
              align-items: center;
              justify-content: flex-end;
              .itemName{
                color: #999999;
                font-size: 0.56rem;
                flex: 1;
                word-break: keep-all;
              }
              .itemType{
                margin-left: 0.4rem;
                color: #666666;
                font-size:0.56rem;
                width:8rem;
                white-space: normal;
                word-break: break-all;
              }
            }
          }
        }
        .itemNav{
          display: flex;
          justify-content: space-between;
          align-items: center;
          color: #1f9eff;
          font-size:0.6rem;
          height: 1.2rem;
          line-height:1.2rem;
          margin: 0 0.5rem;
          padding: 0.4rem;
          background-color: #fff;
          border-bottom-left-radius: 0.2rem;
          border-bottom-right-radius:0.2rem;
          overflow: hidden;
          .arrow{
            display: flex;
            align-items: center;
            img{
              width: 0.56rem;
              height: 0.56rem;
              vertical-align: top;

            }
          }
        }
      }
</style>
